//牛客 HJ40 统计字符

#include <ctype.h>
#include <stdio.h>
int main()
{
    int a = 0, b = 0, c = 0, d = 0;
    char str[100] = "\0";
    gets(str);
    for(int i = 0; i < strlen(str); i++)
    {
        if(isalpha(str[i]))
            a++;
        else if(isspace(str[i]))
            b++;
        else if(isdigit(str[i]))
            c++;
        else
            d++;
    }
    printf("%d\n%d\n%d\n%d\n", a, b, c, d);
    return 0;
}